//============================================================================
// Name        : file.cpp
// Author      : contro
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include"khaibao.h"

int main() {
	char s[100];
	cout<<"nhap file can doc:";
	fflush(stdin);
	gets(s);
	DocFile(s);
	ofstream write;
	int *p,**q,n,m;
	cout<<"\nnhap so pt: ";
	cin>>n;
	p=new int [n];
	Nhap(p,n);
	GhiFile(p,n);
	write.open("/home/lucky/workspace/file/src/tongmang.txt");
	int kq=TongMang(n);
	write<<"Ket qua:"<<kq;
	write.close();
	cout<<"\nkq="<<kq;
	SapXep(n);
	cout<<"\nnhap so dong: ";
	cin>>n;
	cout<<"nhap so cot: ";
	cin>>m;
	q=new int*[n];
	Nhap2Chieu(q,n,m);
	Ghi2Chieu(q,n,m);
	write.open("/home/lucky/workspace/file/src/tong2chieu.txt");
	write<<"Ket qua: "<<Tong2Chieu(n,m);
	write.close();
	SapXep2Chieu(n,m);
	return 0;
}
